// 引入
import { useSelector, useDispatch } from "react-redux";

export default function World() {
  const msg = useSelector((state) => state.msg);
  const count = useSelector((state) => state.count);

  const dispatch = useDispatch();

  return (
    <div>
      <h2>World</h2>
      <p>msg: {msg}</p>
      <p>count: {count}</p>

      <button onClick={() => dispatch({ type: "INCREMENT" })}>ChangeMsg</button>
    </div>
  );
}
